package com.xxxx.mytest.funs

/**
 * @program: day0303
 * @description: 尽信书，则不如无书
 * @author: CoreDao
 * @create: 2021-03-03 09:15
 **/

object funs2 {
  def main(args: Array[String]): Unit = {

    /**
     * 柯里化函数
     * 闭包概念
     */
    def f12(a:Int,b:Int)(c:Int,d:Int) = {
      a + b + c + d
    }
    def f13(a:Int,b:Int,c:Int,d:Int) = {
      a + b + c + d
    }

    println(f12(1, 2)(3, 4))
    println(f13(1, 2, 3, 4))

  }
}
